package com.kyle.entity;

import java.io.Serializable;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

@Entity
@Cache(usage=CacheConcurrencyStrategy.READ_WRITE)
@Table(name="menu")
public class Menu implements Serializable{
	
	
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	private Long id;
	
	@Column(name="pid",unique=false,nullable=true)
	private Long pid;//父节点ID
	
	@Column(name="name",unique=false,nullable=true)
	private String name;//树上的节点的名称
	
	
	@Column(name="url",unique=false,nullable=true)
	private String url;
	
	@Transient
	private String icon = "http://localhost:8080/MoveCheck/images/2.gif";//图标图片的路径
	
	@Transient
	private String click;
	
	//@Column(name="isParent",unique=false,nullable=true)
	//private Boolean isParent;//是否为文件夹节点
	
	//@Column(name="checked",unique=false,nullable=true)
	//private Boolean checked;
	
//	private String target;
	
	public String getClick() {
		click = "treeOnClick('"+url+"','"+this.name+"','"+this.id+"')";
		return click;
	}

	public void setClick(String click) {
		this.click = click;
	}

//	public String getUrl() {
//		return url;
//	}
//
//	public void setUrl(String url) {
//		this.url = url;
//	}

//	public String getTarget() {
//		return target;
//	}
//
//	public void setTarget(String target) {
//		this.target = target;
//	}

	
//	public Boolean getChecked() {
//		return checked;
//	}
//
//	public void setChecked(Boolean checked) {
//		this.checked = checked;
//	}



	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getPid() {
		return pid;
	}

	public void setPid(Long pid) {
		this.pid = pid;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

//	public Boolean getIsParent() {
//		return isParent;
//	}
//
//	public void setIsParent(Boolean isParent) {
//		this.isParent = isParent;
//	}

	public String getIcon() {
		return icon;
	}

	public void setIcon(String icon) {
		this.icon = icon;
	}

}
